<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3" xmlns:head="http://www.w3.org/1999/html">
<head th:include="/public/public_css::public_css ('用户管理')" />

<body>
<div class="layui-fluid larry-wrapper">
    <div class="layui-row layui-col-space30">
        <div class="layui-col-xs24">
            <blockquote class="layui-elem-quote quoteBox">
                <form class="layui-form">
                    <div class="layui-inline">
                        <div class="layui-input-inline">
                            <input type="text" class="layui-input searchVal" placeholder="请输入搜索的内容" />
                        </div>
                        <a class="layui-btn search_btn" data-type="reload">搜索</a>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-normal addNews_btn">添加文章</a>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-danger layui-btn-normal delAll_btn">批量删除</a>
                    </div>
                </form>
            </blockquote>
            <div class="group-button" id="toolbar">
                <a class="layui-btn layui-btn-sm layui-btn-danger">
                    <i class="iconfont">&#xe626;</i> 删除
                </a>
                <a class="layui-btn layui-btn-sm layui-btn-normal add-btn">
                    <i class="layui-icon">&#x1005;</i> 添加
                </a>
                <a class="layui-btn layui-btn-sm modal" data-params='{"content": "brand-edit.html",type:2, "title": "添加品牌"}'>
                    <i class="iconfont">&#xe649;</i> 添加
                </a>
            </div>
            <!--列表-->
            <section class="panel panel-padding" >
                <div class="pro">
                    <table id="table"></table>
                </div>
            </section>
        </div>
    </div>
</div>

</body>
<script type="text/html" id="barDemo">
    <a class="layui-btn layui-btn-xs  layui-btn-primary" lay-event="detail">查看</a>
    <a class="layui-btn layui-btn-xs  layui-btn-primary modal" data-params='{content: "brand-edit.html",data:"id={{ d.id }}",type:"2", title: "{{d.title }}"}' lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="del">删除</a>
</script>

<script type="text/html" id="switch">
    {{# if(d.switch ){ }}
    <input type="checkbox" name="switch" lay-skin="switch" lay-text="ON|OFF" checked="checked" /> {{# }else{ }}
    <input type="checkbox" name="switch" lay-skin="switch" lay-text="ON|OFF" /> {{# } }}
</script>

<script type="text/html" id="barPic">

    <div class="imgbox"><img th:src="@{/plugin/layui/images/upload.jpg}" alt=""/></div>
</script>

<div th:include="/public/public_js::public_js"></div>

<script>
    layui.use(['list','layer','zzpUtils','jquery'],function () {
        var zzpUtils= layui.zzpUtils,
            $ = layui.jquery;
        window.operateEvent ={
            "click .layui-btn-primary":function (e, value, row, index) {
                alert(row.mc);
            }
        }
        zzpUtils.table({
            elem: '#table',
            isApi: true,
            pagination:true,
            url: '/wmsownersupplier/list',
            columns: [{
                field: '',
                checkbox: true
            }, {
                field: 'mc',
                title: '货主名称'
            },{
                field: 'lxr',
                title: '联系人'
            },{
                field: 'dz',
                title: '地址'
            },{
                field: 'beanName',
                title: '实体bean名称'
            },{
                field: 'formType',
                title: '表单类型'
            },{
                field:'caozuo',
                title: '操作',
                events:operateEvent,
                formatter:operateFormatter
            }],
            queryParams: function () {//查询条件
                return {
                    formName: "12312321321"
                };
            },
            detailFormatter: function (index, row) {
                return "这里就没有确定过11";
            }

        });

       function operateFormatter(value, row, index) {
            return [
                '<a class="layui-btn layui-btn-primary layui-btn-xs" >查看</a>',
                '<a class="layui-btn layui-btn-xs">编辑</a>',
                '<a class="layui-btn layui-btn-danger layui-btn-xs">删除</a>'
            ].join('')
        }
        $(".search-btn").on('click',function () {
            zzpUtils.refreshTable("#table");
        })
        $(".add-btn").on('click',function () {
            zzpUtils.fullDialog({
                title:"添加用户",
                type:2,
                content: "/sysuser/addUser"
            });
//            var index = top.layui.layer.open({
//                title : "添加用户",
//                type : 2,
//                content : "12312",
//                success : function(layero, index){
//
////                    var body = layui.layer.getChildFrame('body', index);
////                    if(edit){
////                        body.find(".userName").val(edit.userName);  //登录名
////                        body.find(".userEmail").val(edit.userEmail);  //邮箱
////                        body.find(".userSex input[value="+edit.userSex+"]").prop("checked","checked");  //性别
////                        body.find(".userGrade").val(edit.userGrade);  //会员等级
////                        body.find(".userStatus").val(edit.userStatus);    //用户状态
////                        body.find(".userDesc").text(edit.userDesc);    //用户简介
////                        form.render();
////                    }
////                    setTimeout(function(){
////                        layui.layer.tips('点击此处返回用户列表', '.layui-layer-setwin .layui-layer-close', {
////                            tips: 3
////                        });
////                    },500)
//                }
//            });

//            top.layui.layer.full(index);
//            //改变窗口大小时，重置弹窗的宽高，防止超出可视区域（如F12调出debug的操作）
//            $(window).on("resize",function(){
//                top.layui.layer.full(index);
//            })
        })

    });
</script>
</html>